﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="frmCargoConsulta.aspx.cs" Inherits="frmCargoConsulta" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<h1>Cargo: Consulta y Modificaciones</h1>
    <p style="width: 454px">
        <br />
    </p>
    <p>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AutoGenerateColumns="False" DataKeyNames="idCargo" 
            DataSourceID="SqlDataSource1" 
            EmptyDataText="No hay registros de datos para mostrar.">
            <Columns>
                <asp:BoundField DataField="descripcionCargo" HeaderText="Cargo" 
                    SortExpression="descripcionCargo" />
                <asp:CommandField HeaderText="Acciones" ShowDeleteButton="True" 
                    ShowEditButton="True" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:BD_SAFAConnectionString1 %>" 
            DeleteCommand="DELETE FROM [T_Cargo] WHERE [idCargo] = @idCargo" 
            InsertCommand="INSERT INTO [T_Cargo] ([descripcionCargo]) VALUES (@descripcionCargo)" 
            ProviderName="<%$ ConnectionStrings:BD_SAFAConnectionString1.ProviderName %>" 
            SelectCommand="SELECT [idCargo], [descripcionCargo] FROM [T_Cargo]" 
            UpdateCommand="UPDATE [T_Cargo] SET [descripcionCargo] = @descripcionCargo WHERE [idCargo] = @idCargo">
            <DeleteParameters>
                <asp:Parameter Name="idCargo" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="descripcionCargo" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="descripcionCargo" Type="String" />
                <asp:Parameter Name="idCargo" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
    </p>
    <p>
    </p>
    <p>
        <asp:Button ID="Button1" runat="server" Height="30px" onclick="Button1_Click" 
            Text="Regresar" Width="140px" />
    </p>
    <p>
    </p>
    <p>
    </p>
    <p>
    </p>
</asp:Content>

